<%@ include file="base.jsp" %>

<html>
<head>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
		javascript:window.history.forward(1);
		
		function change_bg(cell)
		{
			cell.className="cell-mouseover";
			document.getElementById(cell).style.backgroundImage ='url(' + "<%=imagePath%>/left-menu-middle-grey.gif" + ')';
		}
		function outset(cell)
		{
			cell.className ="white-smalltext";
			document.getElementById(cell).style.backgroundImage ='url(' +"<%=imagePath%>/left-menu-middle.gif" +')';
		}
		function setAction(clickAction)
		{
			document.LinksUploadForm.action.value = clickAction;
			document.LinksUploadForm.submit();
		}
	//-->
	</SCRIPT>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title><bean:message key="ibroker.changeLinks.title" /></title>
<link rel="stylesheet" type="text/css" href="<%=oStylesheet%>" />
</head>

<body>
<table cellspacing=25 border=0 cellpadding=0>
		<%@ include file="leftMenu.jsp" %>
		<td width=605 valign=top>
		<table>
			<tr>
			<td valign="top">
			<table cellpadding="0" cellspacing="0" width="100%" height="100%">
				<tr height="45px">
					<td height="45px" width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					<td height="45px" bgcolor="#999999" align="left" valign="middle">
						<table cellpadding="0" cellspacing="0">
							<tr>
								<td width="500" align="left">								
									<img src="<%=imagePath%>/title_manager_change_links.gif" align="left"/>
								</td>
								<td width="100" align="right">
									<html:link action="Logout">
										<img src="<%=imagePath%>/button-logout.jpg" border="0" align="right"/>
									</html:link>
								</td>
							</tr>
						</table>
					</td>
					<td height="45px" width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
				</tr>
				<tr height="182px">
					<td width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					<td bgcolor="#CCCCCC" width="585">
						<html:form action="LinksUploadForm" method="POST" enctype="multipart/form-data">
						<table align="center">
							<tr>
								<td width="20" colspan="1">&nbsp;</td>
								<td align="left" colspan="4" class="blue-smalltext"><b><html:errors/></b></td>
							</tr>
							<tr>
								<td width="20" colspan="1">&nbsp;</td>
								<td align="center" colspan="2">
								<b class="blue-smalltext"><bean:message key="ibroker.changeLinks.name" /></b>
								<td align="center" colspan="2">
								<b class="blue-smalltext"><bean:message key="ibroker.changeLinks.address" /></b>
							</tr>
							<%
								String names[][] = new String[len][2];
								if (len > 0)
								{
									String links[] = ((String) session.getAttribute("Links")).split(", ");
									for (int i=0; i<len; i++)
									{
										names[i] = links[i].split("=");
									}
								}
								for (int i=0; i<8; i++)
								{
									if (i<len)
									{
							%>
										<tr>
											<td width="20" colspan="1">&nbsp;</td>
											<td align="left" colspan="2">
											<html:text property="name" styleClass="textbox" value="<%=names[i][0]%>" maxlength="14"></html:text>
											</td>
											<td align="left" colspan="2">
											<html:text property="address" styleClass="textbox" value="<%=names[i][1]%>" size="40" maxlength="255"></html:text>
											</td>
										</tr>
							<%
									}
									else
									{
							%>
										<tr>
											<td width="20" colspan="1">&nbsp;</td>
											<td align="left" colspan="2">
											<html:text property="name" styleClass="textbox" value="" maxlength="14"></html:text>
											</td>
											<td align="left" colspan="2">
											<html:text property="address" styleClass="textbox" value="" size="40" maxlength="255"></html:text>
											</td>
										</tr>
							<%
									}
								}
							%>
							<tr>
								<td>&nbsp;</td>
								<td></td>
							</tr>
							<tr>
								<td width="20" colspan="1">&nbsp;</td>
								<td align="center" colspan="2">
								<img src="<%=imagePath%>/button-submit.jpg" onclick="setAction('upload');"></img>
								</td>
								<td align="center" colspan="2">
								<img src="<%=imagePath%>/button-cancel.jpg" onclick="setAction('cancel');"></img>
								</td>
							</tr>
							<tr>
								<td>
								<html:hidden property="action"></html:hidden>
								</td>
							</tr>
						</table>
						</html:form>
					</td>
					<td width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
				</tr>
				<tr height="10px">
					<td colspan="3" bgcolor="#999999"></td>
				</tr>
			</table>
			</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td colspan=3><hr></td>
	</tr>
</table>
</body>
</html>
